from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

# API路由器
router = DefaultRouter()
router.register(r'file-manager', views.FileManagerViewSet, basename='file-manager')

app_name = 'file_manager'

urlpatterns = [
    # Web视图
    path('', views.file_manager_dashboard, name='dashboard'),
    
    # AJAX接口
    path('ajax/upload/', views.ajax_upload_files, name='ajax_upload_files'),
    path('ajax/files/', views.ajax_file_list, name='ajax_file_list'),
    path('ajax/stats/', views.ajax_file_stats, name='ajax_file_stats'),
    
    # API路由
    path('api/', include(router.urls)),
]